package org.jctc.els.modules.biz.service.projects;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.jctc.els.modules.biz.entity.projects.ElsProjects;
import org.jctc.els.modules.biz.excel.*;
import org.jctc.els.modules.biz.vo.ElsProjectFilesVO;
import org.jctc.els.modules.biz.vo.ElsProjectTeamAuditVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 项目表;(els_projects)表服务接口
 *
 * @author : Ice
 * @date : 2022-6-21
 */
public interface ElsProjectsService extends BaseService<ElsProjects> {

    /**
     * 分页查询
     *
     * @param pageNum
     * @param pageSize
     * @return 查询结果
     */
    IPage<ElsProjects> paginQuery(Integer pageNum, Integer pageSize, String projectName);

    IPage<ElsProjectFilesVO> paginCategoryQuery(Integer pageNum,
                                                Integer pageSize,
                                                Integer projectCategory,
                                                Integer projectType,
                                                String projectName);

    IPage<ElsProjectFilesVO> paginCategoryQueryByExpert(Integer pageNum,
                                                  Integer pageSize,
                                                  Integer projectCategory,
                                                  Integer projectType,
                                                  String projectName,
                                                  Long expertId);


    R importWorkersProjects(MultipartFile multipartFile, HttpServletRequest request, Integer projectCategory, Integer projectType, BladeUser user);

    R importPersonnelProjects(MultipartFile multipartFile, HttpServletRequest request, Integer projectCategory, Integer projectType, BladeUser user);

    R importExploitProjects(MultipartFile multipartFile, HttpServletRequest request, Integer projectCategory, Integer projectType, BladeUser user);

    R importPurchaseProjects(MultipartFile multipartFile, HttpServletRequest request, Integer projectCategory, Integer projectType, BladeUser user);

    R importProduceProjects(MultipartFile multipartFile, HttpServletRequest request, Integer projectCategory, Integer projectType, BladeUser user);

    R importScienceProjects(MultipartFile multipartFile, HttpServletRequest request, Integer projectType);

    /**
     * 导出数据
     */
    List<WorkersProjectsExcel> exportWorkersProjects(Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<PersonnelProjectsExcel> exportPersonnelProjects(Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<ExploitProjectsExcel> exportExploitProjects(Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<PurchaseProjectsExcel> exportPurchaseProjects(Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<ProduceProjectsExcel> exportProduceProjects(Wrapper<ElsProjects> queryWrapper, Integer projectCategory, Integer projectType, Long expertId);

    List<ScienceProjectsExcel> exportScienceProjects(Wrapper<ElsProjects> queryWrapper, Integer projectType, Long expertId);

    /**
     * 专家绑定项目分页查询
     *
     * @return 查询结果
     */
    IPage<ElsProjects> selectProjects(IPage<ElsProjects> page, String projectNumber,
                                      String orgName,
                                      String projectName,
                                      String category1,
                                      String category2,
                                      String category3,
                                      String projectLevel,
                                      String trainingCategory,
                                      String trainingType,
                                      String trainingMode,
                                      String deptApply,
                                      String deptHost,
                                      String orgBy,
                                      String implementScope,
                                      String purchaseCategory,
                                      String specializedCategory,
                                      String openTime,
                                      String completionTime,
                                      Integer projectType
    );

    /**
     * 小组绑定的所有的项目
     *
     * @param page
     * @param teamId
     * @return
     */
    IPage<ElsProjects> selectBoundProjects(IPage<ElsProjects> page, String teamId, String projectNumber,
                                           String orgName,
                                           String projectName,
                                           String category1,
                                           String category2,
                                           String category3,
                                           String projectLevel,
                                           String trainingCategory,
                                           String trainingType,
                                           String trainingMode,
                                           String deptApply,
                                           String deptHost,
                                           String orgBy,
                                           String implementScope,
                                           String purchaseCategory,
                                           String specializedCategory,
                                           String openTime,
                                           String completionTime);

    IPage<ElsProjectTeamAuditVO> paginQueryTeamAudit(Integer pageNum,
                                                     Integer pageSize,
                                                     String projectName,
                                                     Long userId,
                                                     Integer projectCategory,Long teamId,Integer status);

    IPage<ElsProjectTeamAuditVO> paginQueryAdminAudit(Integer pageNum,
                                                     Integer pageSize,
                                                     String projectName,
                                                     Long userId,
                                                     Integer projectCategory,Long teamId,Integer status);

    boolean removes(List<Long> ids);

    IPage<ElsProjectFilesVO> paginCategoryQueryBySpecial(Integer pageNum, Integer pageSize, Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<WorkersProjectsExcel> paginCategoryQueryByExpertExcel(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<WorkersProjectsExcel> paginCategoryQueryBySpecialExcel(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<WorkersProjectsExcel> paginCategoryQueryExcel(Integer projectCategory, Integer projectType, String projectName);

    IPage<ElsProjectFilesVO> paginCategoryQueryByDeptId(Integer pageNum, Integer pageSize, Integer projectCategory, Integer projectType, String projectName, String deptId);

    List<ProduceProjectsExcel> paginCategoryQueryByExpertExcelProject(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<ProduceProjectsExcel> paginCategoryQueryBySpecialExcelProject(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<ProduceProjectsExcel> paginCategoryQueryExcelProject(Integer projectCategory, Integer projectType, String projectName);

    List<PurchaseProjectExcel> paginCategoryQueryByExpertExcelPurchase(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<PurchaseProjectExcel> paginCategoryQueryBySpecialExcelPurchase(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<PurchaseProjectExcel> paginCategoryQueryExcelPurchase(Integer projectCategory, Integer projectType, String projectName);

    List<ExploitProjectsExcel> paginCategoryQueryByExpertExcelExploit(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<ExploitProjectsExcel> paginCategoryQueryBySpecialExcelExploit(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<ExploitProjectsExcel> paginCategoryQueryExcelExploit(Integer projectCategory, Integer projectType, String projectName);

    List<PersonnelProjectsExcel> paginCategoryQueryByExpertExcelPersonnel(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<PersonnelProjectsExcel> paginCategoryQueryBySpecialExcelPersonnel(Integer projectCategory, Integer projectType, String projectName, Long userId);

    List<PersonnelProjectsExcel> paginCategoryQueryExcelPersonnel(Integer projectCategory, Integer projectType, String projectName);
}